1. Field of the Invention
The present invention relates to a technology of coding moving pictures, and, more particularly, to an picture coding device, picture coding method, picture coding program, picture decoding device, picture decoding method, and picture decoding program configured to partition a picture into rectangular blocks and estimate and compensate for motion between pictures in units of blocks.
2. Description of the Related Art
In a moving picture coding system as exemplified by MovingPictureCodingExpertsGroup (MPEG), in which a picture is partitioned into rectangular blocks, and motion between pictures is estimated and compensated for in units of blocks, a motion vector is predicted in order to reduce the code size of motion vectors generated in the blocks.
In MPEG-2, the code size is reduced by derivating a difference between a motion vector detected in a given macroblock and a motion vector for an immediately previously coded macroblock, and by coding the difference. In MPEG-4AVC/H.264, strong correlation of a given motion vector to a motion vector for an immediately neighboring block is taken advantage of such that the code size is reduced by performing prediction from an immediately neighboring block and by coding the resultant differential vector. More specifically, a motion vector is predicted by derivating a median value from motion vectors for neighboring blocks to the left of, above, and to the upper right of a target block subject to a prediction process, and by derivating a difference from the median value.
In these prediction methods, only one motion vector is available for prediction. Therefore, if the prediction fails, the difference between motion vectors will grow accordingly, resulting in an increase in the code size. Further, aside from the fact that the code size of a motion vector is reduced, other motion information is coded in units of target blocks. Therefore, even if a given block has the same motion information as an immediately neighboring block, the information is coded in a duplicate manner, resulting in less efficient coding.
In order to solve these problems, two new technologies are being studied in working out the standard for moving picture coding in ISO/IEC and ITU-T. One approach relates to prediction of a motion vector. The use of a motion vector for a coded immediately neighboring block as a motion vector predictor candidate, and the use of a motion vector for a block neighboring a block located in another picture at a different point of time at a position equivalent to that of the target prediction block, are evaluated for the generated code size.
FIGS. 1A and 1B show examples of neighboring blocks that could be candidates for motion vector predictors. FIG. 1A shows examples of neighboring blocks in the same picture. FIG. 1B show an example of a block neighboring a block located in another picture at a different point of time at a position equivalent to that of the target prediction block. The motion vectors for these blocks are defined as motion vector predictor candidates. The difference between the motion vector for the target block and the motion vector predictor candidate that produces the minimum code size is identified, and the associated candidate is selected as the motion vector predictor. The difference from the motion vector predictor and, if necessary, additional information related to the neighboring block in which the motion vector predictor is selected are coded and transmitted.
In another approach, if the motion information on a target block and the motion information on a neighboring block already coded are identical, the motion information of the target block is not coded and the motion information of the neighboring block is used for coding. More specifically, this approach is directed to reducing the code size of motion information by coding additional information designating a neighboring block having reference motion information (motion information that should be referred to) (see, for example, patent document 1). Such a method is called merge and gains attention as a method of reducing the code size of motion information.
[patent document 1] JP10-276439
In the above methods for motion vector prediction and merge is used coding information including a motion vector, a reference picture number (indicating the picture that should be referred to), a reference list, etc. for an immediately neighboring block already coded or for a block neighboring a block located in another picture at a different point of time at a position equivalent to that of the target prediction block. However, since the positions of neighboring blocks referred to differ according to the techniques, the number of accesses to the memory storing coding information already coded will be disadvantageously increased.
Further, in order to select the most suitable reference target in an ordinary coding process, motion compensation is performed by using the coding information of a reference neighboring block, and decision is made by using the generated code size and coding distortion as indices. However, use of different neighboring blocks for reference leads to an increase in the number of blocks with the result that the processing load is increased. Another problem is that constraints may be imposed on the timing to read decoded coding information at the time of decoding, or the capacity of a temporary memory required to store decoded coding information is increased.